<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex align-stretch benben-position-layout flex news_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex align-center justify-between flex-sub news_fd0_0'>
					<view class='flex align-center news_fd0_0_c0'>
						
					</view>
					<view class='flex align-center'>
						<text class='news_fd0_0_c1_c0'>消息</text>
					</view>
					<view class='flex align-center news_fd0_0_c0'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<view class="loading_css" v-if="isShow">
				<u-loading size="36" color="#E60012"></u-loading>
				<view>加载中</view>
			</view>
			<!---平台消息flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch justify-center benben-flex-layout" v-else>
				<template v-for='(item,key0) in list'>
					<view class='flex flex-direction flex-wrap align-stretch news_fd1_0' @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/grzx/newDetail/newDetail?id=${item.aid}`" :key='key0'>
						<text class='news_fd1_0_c0'>{{item.title}}</text>
						<text class='news_fd1_0_c1'>{{item.synopsis}}</text>
						<image class='news_fd1_0_c2' mode="aspectFill" :src='item.thumb' v-if="item.thumb"></image>
						<view class='flex flex-wrap align-center justify-between news_fd1_0_c3'>
							<text class='news_fd1_0_c3_c0'>{{item.create_time}}</text>
							<text class='fu-iconfont2  news_fd1_0_c3_c1'>&#xe78e;</text>
						</view>
					</view>
				</template>
				<view class="loadmore" v-if="last_page > 1">
					<u-loadmore font-size="24" :status="status" :icon-type="iconType" :load-text="loadText" />
				</view>
			</view>

			<!---平台消息flex布局结束-->
			<view class="noData" v-if="list.length == 0 && !isShow">
				<image :src='STATIC_URL+"no.png"'></image>
			</view>

		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},

		data() {
			return {
				"list": [],
				"page": 1,
				"is_pull": true,
				"last_page": 1,
				"status": 'loadmore',
				"iconType": 'flower',
				"loadText": {
					loadmore: '轻轻上拉',
					loading: '努力加载中',
					nomore: '我也是有底线的'
				},
				"isShow": true,
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.getList()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		// 下拉刷新
		onPullDownRefresh() {
			this.page = 1;
			this.is_pull = true;
			this.isShow = true;
			this.getList();
		},
		// 上拉加载
		onReachBottom() {
			if (this.page >= this.last_page) return;
			this.status = 'loading';
			this.page++;
			setTimeout(() => {
		
				if (this.page >= this.last_page) this.status = 'nomore';
				else this.status = 'loading';
				this.is_pull = false;
				this.getList();
			}, 500)
		},
		onPageScroll(e) {

		},
		methods: {
			// 公告列表  post65deaab693c83
			getList() {
				this.$api.post(global.apiUrls.post65deaab693c83, {
					page: this.page
				}).then(res => {
					// console.log(res);
					uni.stopPullDownRefresh();
					this.isShow = false;
					if (res.data.code == 1) {
						this.last_page = res.data.data.last_page;
						if (this.is_pull) {
							this.list = res.data.data.data;
						} else {
							this.list = this.list.concat(res.data.data.data);
						}
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #F8F8F8;
		background-size: 100% auto;
	}

	.news_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.news_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
	}

	.news_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #333;
	}

	.news_fd0_0_c0 {
		width: 180rpx;
	}

	.news_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.news_fd1_0_c3_c1 {
		font-size: 26rpx;
	}

	.news_fd1_0_c3_c0 {
		color: #999999;
		font-size: 24rpx;
		font-weight: 400;
		line-height: 33rpx;
	}

	.news_fd1_0_c3 {
		border-top: 1px solid rgba(238, 238, 238, 1);
		padding: 20rpx 36rpx 18rpx 36rpx;
		margin: 18rpx 0rpx 0rpx 0rpx;
	}

	.news_fd1_0_c2 {
		width: 614rpx;
		height: 298rpx;
		border-radius: 15rpx;
		margin: 18rpx 36rpx 0rpx 36rpx;
	}

	.news_fd1_0_c1 {
		margin: 24rpx 0rpx 0rpx 0rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: #666666;
		-webkit-line-clamp: 3;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.news_fd1_0_c0 {
		line-height: 36rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
		padding: 0rpx 32rpx 0rpx 32rpx;
		-webkit-line-clamp: 1;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
	}

	.news_fd1_0 {
		background: #fff;
		margin: 24rpx 36rpx 0rpx 36rpx;
		padding: 32rpx 0rpx 0rpx 0rpx;
		background-size: 100% auto !important;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}
</style>